export function getTreeData(data, currentId = '0') {
  return data.filter(item => item.pid === currentId)
    .map(item => {
      item.children = getTreeData(data, item.id);
      return item;
    })
}
export function getData(data) {
  return data.map(item => (
    {
      id: item.id,
      label: item.name,
      children: getData(item.children),
    }
  ))
}
// 简单数据类型去重
export function unique(arr) {
  return Array.from(new Set(arr));
}
